import {
  SeatsGroupListRequest,
  SeatsGroupListRespons,
  SeatsGroupStatusRequest,
  SeatsGroupStatusResponse,
} from 'admin/schema/SeatMonitor';
import $http from '../../../servers/http';
import { Result } from '../../schema/Result';
import qs from 'query-string';

/**获取坐席列表-模糊搜索坐席组（人机、人人执行中任务，无数据权限） */
export const getSeatGroupMonitorList = (
  data: SeatsGroupListRequest
): Promise<Result<SeatsGroupListRespons[]>> => {
  return $http.get({
    url: `/seats/monitor/seatsgrouplist`,
    data,
  });
};

/**获得坐席组监控数据 */
export const getSeatMonitorData = (
  data: SeatsGroupStatusRequest
): Promise<Result<SeatsGroupStatusResponse>> => {
  // get请求，需要转换***数组
  const params = qs.stringify({ seatsGroupIds: data.seatsGroupIds });
  return $http.get({
    url: `/seats/monitor/seatsgroupstatus?${params}`,
  });
};
